package edu.hbsi.demo4;
class MyException extends Exception {

}
class TestException {
    public static void main(String[] args) {
        try {
            int result = ma();
            System.out.println("Result: " + result);
        } catch (MyException e) {
            System.out.println("MyException caught");
        }
    }
    public static int ma() throws MyException {
        try {
            m();
            return 100;
        } catch (MyException e) {
            System.out.println("MyException");
            throw e;
        }
    }
    public static void m() throws MyException {
        throw new MyException();
    }
}